package day06_exception_collection.com.itheima.d1_exception;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Demo5_Exception {
    public static void main(String[] args) {
        System.out.println("开始。。。");

        try {
            parseDate2("2020-09-08 11:11:23");
        } catch (Exception e){
            e.printStackTrace();
        }

        System.out.println("结束。。。");
    }

    public static void parseDate(String s) throws ParseException, FileNotFoundException {
        Date date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(s);
        FileInputStream fis = new FileInputStream("d:/a.txt");

    }

    public static void parseDate2(String s) throws Exception {
        Date date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(s);
        FileInputStream fis = new FileInputStream("d:/a.txt");

    }
}
